package cn.csxw.openchina.ui.fragment;

import android.content.Intent;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import butterknife.BindView;
import butterknife.OnClick;
import cn.csxw.openchina.R;
import cn.csxw.openchina.base.BaseFragment;
import cn.csxw.openchina.ui.activity.MyBlogActivity;
import cn.csxw.openchina.ui.activity.MyFollowActivity;
import cn.csxw.openchina.ui.activity.MyFollowFansActivity;
import cn.csxw.openchina.ui.activity.MyMessageActivity;
import cn.csxw.openchina.utils.Global;

import static android.content.Intent.FLAG_ACTIVITY_NEW_TASK;

/**
 * 我的
 */

public class MyFragment extends BaseFragment {
    @BindView(R.id.iv_head)
    ImageView mIvHead;
    @BindView(R.id.tv_username)
    TextView mTvUsername;
    @BindView(R.id.tv_integration)
    TextView mTvIntegration;
    @BindView(R.id.tv_collect)
    TextView mTvCollect;
    @BindView(R.id.tv_follow)
    TextView mTvFollow;
    @BindView(R.id.tv_fans)
    TextView mTvFans;
    @BindView(R.id.iv_qr_code)
    ImageView mIvQrCode;
    @BindView(R.id.tv_message)
    TextView mTvMessage;
    @BindView(R.id.tv_blog)
    TextView mTvBlog;
    @BindView(R.id.tv_note)
    TextView mTvNote;
    @BindView(R.id.tv_team)
    TextView mTvTeam;
    @BindView(R.id.btn_integration)
    LinearLayout mBtnIntegration;
    @BindView(R.id.btn_collect)
    LinearLayout mBtnCollect;
    @BindView(R.id.btn_follow)
    LinearLayout mBtnFollow;
    @BindView(R.id.btn_fans)
    LinearLayout mBtnFans;
    @BindView(R.id.iv_sex)
    ImageView mIvSex;

    @Override
    public int getLayoutRes() {
        return R.layout.fragment_my;
    }

    @Override
    public void initView() {

    }

    @Override
    public void initListener() {

    }

    @Override
    public void initData() {

    }

    @Override
    public void onClick(View v, int id) {
    }



    @OnClick({R.id.btn_integration, R.id.btn_collect, R.id.btn_follow, R.id.btn_fans})
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.btn_integration://积分
                break;
            case R.id.btn_collect://收藏
                break;
            case R.id.btn_follow://关注
                follow();
                break;
            case R.id.btn_fans://粉丝
                fans();
                break;
            case R.id.iv_qr_code://二维码
                break;
            case R.id.tv_message://消息
                message();
                break;
            case R.id.tv_blog://博客
                blog();
                break;
            case R.id.tv_note://标签
                break;
            case R.id.tv_team://团队
                break;
        }
    }

    private void blog() {
        Intent intent = new Intent(Global.mContext, MyBlogActivity.class);
        intent.setFlags(FLAG_ACTIVITY_NEW_TASK);
        Global.mContext.startActivity(intent);
    }

    //我的   粉丝界面的跳转
    private void fans() {
        Intent intent = new Intent(Global.mContext, MyFollowFansActivity.class);
        intent.setFlags(FLAG_ACTIVITY_NEW_TASK);
        Global.mContext.startActivity(intent);
    }
    //我的   关注界面的跳转
    private void follow() {
        Intent intent = new Intent(Global.mContext, MyFollowActivity.class);
        intent.setFlags(FLAG_ACTIVITY_NEW_TASK);
        Global.mContext.startActivity(intent);
    }
    //我的--》消息
    private void message() {
        Intent intent = new Intent(Global.mContext, MyMessageActivity.class);
        intent.setFlags(FLAG_ACTIVITY_NEW_TASK);
        Global.mContext.startActivity(intent);
    }
}
